﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;

namespace SLVS
{
    public partial class MineClass : UserControl
    {
        public bool clicked = false;
        public bool clicking = false;
        public bool mined = false;
        public bool tagged = false;
        public int mnum = 0;
        public int X;
        public int Y;
        SolidColorBrush brush = new SolidColorBrush();

        public MineClass()
        {
            InitializeComponent();
            this.Width = 25;
            this.Height = 25;

            this.MouseLeftButtonDown += new MouseButtonEventHandler(MineMouseDown);

        }
        public virtual new double Height
        {
            get { return LayoutRoot.Height;}
            set
            {
                LayoutRoot.Height = value;
                btn.Height = value;
            }
        }
        public virtual new double Width
        {
            get { return LayoutRoot.Width; }
            set
            {
                LayoutRoot.Width = value;
                btn.Width = value;
            }

        }
        public double Left
        {
            get { return Translate.X; }
            set { Translate.X = value; }
        }
        public double Top
        {
            get { return Translate.Y; }
            set { Translate.Y = value; }
        }
        public Color ButtonColor
        {
            get { return brush.Color; }
            set
            {
                brush.Color = value;
                btn.Background = brush;
            }
        }

        void MineMouseDown(object sender, MouseButtonEventArgs e)
        {
            clicking = true;
        }

        public void IsClicked()
        {
            clicked = true;
            ButtonColor = Color.FromArgb(100, 0, 0, 0);
            btn.Opacity = 10;
        }
        public void Retrieve()
        {
            ButtonColor = Color.FromArgb(100, 255, 0, 0);
            btn.Content = "";
            clicked = false;
        }
    }
}
